package java8Up;

/**
 * @author Fang Ruichuan
 * @date 2022-09-25 21:06
 */

public class FatherAndSonTest {
    public static void main(String[] args) {
        Son son = new Son();
        son.modifyFatherNumber();
    }
}

class Father {
    private Integer fatherNumber = 10;

    public Integer getFatherNumber() {
        return fatherNumber;
    }

    public void setFatherNumber(Integer fatherNumber) {
        this.fatherNumber = fatherNumber;
    }
}

class Son extends Father {

    public void modifyFatherNumber() {
        this.setFatherNumber(this.getFatherNumber() + 10);
        System.out.println(this.getFatherNumber());
    }
}
